package com.lihaozhe.restclient.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author 李昊哲
 * @version 1.0.0
 */
@Component
@ConfigurationProperties(prefix = "api")
public class ApiConfig {
  /**
   * 协议
   */
  private String protocol;
  /**
   * 远程主机地址
   */
  private String host;
  /**
   * 远程主机端口
   */
  private String port;

  public String getProtocol() {
    return protocol;
  }

  public void setProtocol(String protocol) {
    this.protocol = protocol;
  }

  public String getHost() {
    return host;
  }

  public void setHost(String host) {
    this.host = host;
  }

  public String getPort() {
    return port;
  }

  public void setPort(String port) {
    this.port = port;
  }

  /**
   * 远程主机URL
   *
   * @return 远程主机URL
   */
  public String getUrl() {
    return this.protocol + "://" + this.host + ":" + this.port;
  }
}
